<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="true"  resizable="true" width="30%"
		  widgetVar="dialogAddAula" id="idDialogAdAula" closable="true"
		  appendTo="@(body)" header="Adicionar Aulas"> 	
  	
	 <link rel="stylesheet" type="text/css" href="./estilos.css"/>  
<h:form id="formDialogAdAula" prependId="false">
<h:panelGroup id="pgDialogAddAula">

 	<p:messages id="messagesAddAulas" autoUpdate="true" closable="true" /> 
 		<h:panelGroup>
    	<h:panelGrid id="pgModalidade" columns="3" style="margin-right:10%;"> 
    		<h:outputLabel value="Código" styleClass="outputLabel"/>   
            <h:outputLabel value="Modalidade" styleClass="outputLabel"/>  
            <h:outputLabel  /> 
            <p:inputText value="#{funcionarioBean.professorAula.modalidade.idModalidade}" style="width:80px;">
  				<p:ajax  listener="#{funcionarioBean.onChangeModalidade}" update="pgModalidade"/>
            </p:inputText>  
  			<p:inputText  value="#{funcionarioBean.professorAula.modalidade.descricao}" styleClass="inputDescricao" >
            	<p:ajax  listener="#{funcionarioBean.onChangeModalidadeNull}" update="pgModalidade" />
			</p:inputText> 
  			<p:commandButton icon="ui-icon-search" actionListener="#{funcionarioBean.openDialogConsultarModalidade}" process="@this" styleClass="commandButton"/> 
        </h:panelGrid>  
      	</h:panelGroup>
      	<h:panelGroup>
    	<h:panelGrid columns="2">
    		<h:outputText value="Horas Semanais" styleClass="outputLabel"/>
    		<h:outputText value="Salário" styleClass="outputLabel"/>
    		<p:inputText value="#{funcionarioBean.professorAula.qtdHoras}" styleClass="inputData" maxlength="3">
    			<f:convertNumber type="number"/>
    		</p:inputText>
    		<p:inputText value="#{funcionarioBean.professorAula.salario}" styleClass="inputData"  maxlength="6" >
    			<f:convertNumber type="number"/>
    		</p:inputText>
    	</h:panelGrid>  
    	</h:panelGroup>
    	<h:panelGrid columns="2">
			<p:commandButton value="Adicionar" action="#{funcionarioBean.addAula}" update="pgDialogAddAula" process="@this pgDialogAddAula" />
			<p:commandButton value="Cancelar" onclick="dialogAddAula.close()"/>
			
    	</h:panelGrid> 

 </h:panelGroup>
 </h:form>
 <ui:include src="/view/funcionario/dialogConsultarModalidade.xhtml"></ui:include>
</p:dialog>
